class Solution:
    def containsDuplicate(self, nums: List[int]) -> bool:
        nums.sort()
        n = len(nums)
        if n <= 1:
            return False
        for i in range(1, n):
            while nums[i] == nums[i-1]:
                return True
        return False
